package pers.qianyu.month_202012.date_20201224;

import java.util.*;

/**
 * 575. 分糖果
 * https://leetcode-cn.com/problems/distribute-candies/
 *
 * @author mizzle rain
 * @date 2020-12-24 17:42
 */
public class DistributeCandies {
    public int distributeCandies(int[] candyType) {
        HashSet<Integer> set = new HashSet<>();
        for (int c : candyType) {
            set.add(c);
        }
        return Math.min(candyType.length >> 1, set.size());
    }
}
